package com.example.springboot_template.Service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.springboot_template.Service.UserService;
import com.example.springboot_template.model.domain.DTO.userDTO;
import com.example.springboot_template.mapper.UserMapper;
import com.example.springboot_template.model.domain.User;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author liu
* @description 针对表【user】的数据库操作Service实现
* @createDate 2024-08-02 19:32:18
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
    implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public boolean saveUser(userDTO user) {
        User registerUser = new User();
        BeanUtils.copyProperties(user,registerUser);
        int insertLog = userMapper.insert(registerUser);
        return insertLog > 0;
    }
}




